function checkFormElement(txtId,spanId,rexObj,errorInfo) {
    var textObj = document.getElementById(txtId);
    var spanObj = document.getElementById(spanId);
    if(rexObj.test(textObj.value)){
        spanObj.innerHTML = "验证通过";
        spanObj.style.color = "green";
        return true;
    }
    else{
        spanObj.style.color = "red";
        spanObj.innerHTML=errorInfo;
        return false;
    }
}